<?php

namespace app\common\model\mysql;

use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\Model;
use think\model\relation\HasOne;

class User extends BaseModel
{
    public $schema=[
        'id'=>'int',
        'name'=>'varchar',
        'phone_number'=>'varchar',
        'sex'=>'tinyint',
        'avatar'=>'varchar',
        'status'=>'tinyint',
        'autherized'=>'tinyint',
        'last_login_time'=>'int',
        'last_login_ip'=>'varchar',
        'id_card'=>'varchar',
        'open_id'=>'varchar',
        'create_time'=>'int',
        'update_time'=>'int'
    ];

    public function userInfo(): HasOne
    {
        return $this->hasOne(UserInfo::class,'user_id');
    }
}
